Qualcomm AI Engine Direct - Debugger Converge Phase 1: Introduce debug handle#17804
Qualcomm AI Engine Direct - Debugger Converge Phase 1: Introduce debug handle#17804winskuo-quic wants to merge 1 commit intopytorch:mainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/17804
Note: Links to docs will display an error until the docs builds have been completed. ❌ 3 New FailuresAs of commit 7a91e7c with merge base f40bc56 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
|
Hi @Gasoonjia, @cccclai, |
Gasoonjia
left a comment
There was a problem hiding this comment.
LGTM, thanks for your work!
| """ | ||
| Caution: This pass is executed as the last of the edge_passes. | ||
| For any passes executed during qnn_preprocess, users will need to handle debug_handle ID themselves. | ||
|
|
There was a problem hiding this comment.
maybe we should add a comment here, highlighting that conditional branch like torch.cond is not supported right now.
There was a problem hiding this comment.
Hi @Gasoonjia,
Thanks for reviewing the PR.
I do have a comment below in line 31 for mentioning about conditional branch.
Do you think the comment looks good to you?
There was a problem hiding this comment.
hi @winskuo-quic, it would be great to highlight that at the beginning of the class. User will first and sometimes only read the class-level comment and it will be great if we can warn them potential issue here.
|
|
||
| # The second value in each tuple in `default_passes_and_setting` indicates whether the corresponding pass is activated by default. | ||
| # If a pass is activated, it will be executed by default. | ||
| default_passes_and_setting = [ |
There was a problem hiding this comment.
ok so the order in this list will be the order applying the corresponding pass after to_edge right?
There was a problem hiding this comment.
So the order is determined using the dependency table under backends/qualcomm/_passes/utils.py.
I made ResolveDebugHandle as the last executed pass in the dependency table. I have also added an assertion check under qnn_pass_manager.py to ensure this is the last pass for edge_transform.
Summary
We will be replacing part of the features in Qualcomm Intermediate Debugger with ExecuTorch's Debugger shortly.
This includes using Intermediate_Output_Capturer to capture CPU golden output and calculate_numeric_gap to perform tensor to tensor comparison.
To reuse these features, one key component is to enable debug_handle since ExecuTorch's tool saves per tensor result with mapping of {debug_handle : tensor_value}
This PR will be the 1st stage of debugger convergence, which is to enable debug_handle.
Test plan
python -m unittest executorch.backends.qualcomm.tests.test_passes.TestPasses.test_resolve_debug_handle